.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field__label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-field__required {
  color: #dc2626;
  font-weight: 600;
}

.form-field__input-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-field__input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
  background-color: #ffffff;
  transition: all 0.2s ease;
  outline: none;
}

.form-field__input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-field__input::placeholder {
  color: #9ca3af;
}

/* 自定义下拉框在表单中的样式 */
.form-field__custom-select {
  flex: 1;
}

.form-field__custom-select .custom-select__trigger {
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background-color: #ffffff;
  min-height: auto;
  transition: all 0.2s ease;
}

.form-field__custom-select .custom-select__trigger:hover {
  border-color: #4ade80;
  background-color: #f0f9f0;
}

.form-field__custom-select.custom-select--open .custom-select__trigger {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
  background-color: #f0f9f0;
}

.form-field__custom-select .custom-select__value {
  color: #374151;
}

.form-field__custom-select .custom-select__value--placeholder {
  color: #9ca3af;
}

.form-field__custom-select .custom-select__arrow {
  color: #22c55e;
}

.form-field__custom-select .custom-select__dropdown {
  border: 1px solid #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.form-field__custom-select .custom-select__option:hover {
  background-color: #f0f9f0;
  color: #22c55e;
}

.form-field__custom-select .custom-select__option--selected {
  background-color: #22c55e;
  color: #ffffff;
  font-weight: 500;
}

.form-field__custom-select .custom-select__option--selected:hover {
  background-color: #16a34a;
  color: #ffffff;
}

.form-field__select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2322c55e' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-field__select:hover {
  border-color: #4ade80;
  background-color: #f0f9f0;
}

.form-field__select:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
  background-color: #f0f9f0;
}

/* 下拉选项样式 */
.form-field__select option {
  background-color: #ffffff !important;
  color: #374151 !important;
  padding: 10px 16px;
  border: none;
  font-size: 14px;
  line-height: 1.5;
  transition: all 0.2s ease;
}

.form-field__select option:hover {
  background-color: #f0f9f0 !important;
  color: #22c55e !important;
  font-weight: 500;
}

.form-field__select option:checked {
  background-color: #22c55e !important;
  color: #ffffff !important;
  font-weight: 600;
}

.form-field__select option:focus {
  background-color: #f0f9f0 !important;
  color: #22c55e !important;
  outline: none;
}

/* 覆盖浏览器默认的选中样式 */
.form-field__select option:selected {
  background-color: #22c55e !important;
  color: #ffffff !important;
  font-weight: 600;
}

/* 覆盖浏览器默认的悬停样式 */
.form-field__select option:hover:not(:checked) {
  background-color: #f0f9f0 !important;
  color: #22c55e !important;
}

/* 覆盖浏览器默认的焦点样式 */
.form-field__select option:focus:not(:checked) {
  background-color: #f0f9f0 !important;
  color: #22c55e !important;
}

/* 下拉选项分组样式 */
.form-field__select optgroup {
  background-color: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.form-field__select optgroup option {
  background-color: #ffffff;
  color: #374151;
  padding-left: 24px;
  font-weight: 400;
}

/* 下拉选项分隔线 */
.form-field__select option[disabled] {
  background-color: #f8fafc;
  color: #9ca3af;
  border-bottom: 1px solid #e2e8f0;
  font-style: italic;
}

/* 下拉框禁用状态 */
.form-field__select:disabled {
  background-color: #f9fafb;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

.form-field__select:disabled:hover {
  background-color: #f9fafb;
  border-color: #e5e7eb;
}

/* 下拉框错误状态 */
.form-field__select.error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-field__select.error:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* 下拉框成功状态 */
.form-field__select.success {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* 自定义下拉箭头动画 */
.form-field__select:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2322c55e' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

.form-field__textarea {
  resize: vertical;
  min-height: 80px;
}

.form-field__add-btn,
.form-field__remove-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.form-field__add-btn {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(74, 222, 128, 0.2);
}

.form-field__add-btn:hover {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 4px 8px rgba(74, 222, 128, 0.3);
}

.form-field__remove-btn {
  background-color: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.form-field__remove-btn:hover {
  background-color: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

.form-field__add-icon,
.form-field__remove-icon {
  font-size: 16px;
  font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .form-field__input-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .form-field__add-btn,
  .form-field__remove-btn {
    width: 100%;
    height: 40px;
  }
  
  .form-field__select {
    font-size: 16px; /* 防止iOS缩放 */
    padding: 14px 16px;
    padding-right: 50px;
  }
  
  .form-field__select option {
    padding: 12px 16px;
    font-size: 16px;
  }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .form-field__select {
    background-size: 20px;
    background-position: right 14px center;
  }
}

/* 浏览器特定样式覆盖 */
/* WebKit浏览器 (Chrome, Safari, Edge) */
@supports (-webkit-appearance: none) {
  .form-field__select option {
    background-color: #ffffff !important;
    color: #374151 !important;
  }
  
  .form-field__select option:checked,
  .form-field__select option:selected {
    background-color: #22c55e !important;
    color: #ffffff !important;
  }
  
  .form-field__select option:hover {
    background-color: #f0f9f0 !important;
    color: #22c55e !important;
  }
}

/* Firefox浏览器 */
@-moz-document url-prefix() {
  .form-field__select option {
    background-color: #ffffff !important;
    color: #374151 !important;
  }
  
  .form-field__select option:checked {
    background-color: #22c55e !important;
    color: #ffffff !important;
  }
}

/* 通用样式覆盖 */
.form-field__select option::-moz-selection {
  background-color: #22c55e !important;
  color: #ffffff !important;
}

.form-field__select option::selection {
  background-color: #22c55e !important;
  color: #ffffff !important;
}

/* Electron环境特定样式 */
.form-field__select option {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* 强制覆盖所有可能的默认样式 */
.form-field__select option:not(:disabled) {
  background-color: #ffffff !important;
  color: #374151 !important;
}

.form-field__select option:not(:disabled):hover {
  background-color: #f0f9f0 !important;
  color: #22c55e !important;
}

.form-field__select option:not(:disabled):checked,
.form-field__select option:not(:disabled):selected {
  background-color: #22c55e !important;
  color: #ffffff !important;
}

/* 确保在Electron中也能正确显示 */
.form-field__select option[selected] {
  background-color: #22c55e !important;
  color: #ffffff !important;
  font-weight: 600;
}
